import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, Matches } from 'class-validator';

export class LoginDto {
  @ApiProperty({ description: '手机号', example: '13000000000' })
  @Matches(/^1[3456789]\d{9}$/, { message: '手机号格式不正确' })
  @IsNotEmpty({ message: '手机号不能为空' })
  mobile: string;

  @ApiProperty({ description: '密码', example: '123456' })
  @IsNotEmpty({ message: '密码不能为空' })
  password: string;
}
